(display "\n========================================\n")
(define (element-of-set x set)
    (cond   ((null? set) #f)
            ((= x (car set)) #t)
            ((< x (car set)) #f)
            (else (element-of-set x (cdr set)))))

(define (intersection-set set1 set2)
    (if (or (null? set1) (null? set2))
        '()
        (let ((x1 (car set1)) (x2 (car set2)))
            (cond   ((= x1 x2)
                        (cons x1
                              (intersection-set (cdr set1) (cdr set2))))
                    ((< x1 x2)
                        (intersection-set (cdr set1) set2))
                    ((> x1 x2)
                        (intersection-set set1 (cdr set2)))))))
; (display (intersection-set (list 1 2 3) (list 2 3 4)))

(define (adjoin-set x set)
    (if (null? set)
        (list x)
        (let ((current-element (car set))
              (remain-element (cdr set)))
            (cond   ((= x current-element)
                        set)
                    ((< x current-element)
                        (cons x set))
                    ((> x current-element)
                        (cons current-element
                              (adjoin-set x remain-element)))))))

(display (adjoin-set 10 (list 1 2 3 9)))

(display "\n========================================\n")
